package view;

import javax.swing.table.AbstractTableModel;

public class EventTableModel extends AbstractTableModel {

	private String[] columnNames = null;
	private Object[][] data = null;
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public EventTableModel(Object[][] events, String[] titles) {
		super();
		columnNames = titles;
		data = events;
	}

	@Override
	public int getColumnCount() {
		return columnNames.length;
	}

	@Override
	public int getRowCount() {
		return data.length;
	}
	
    public String getColumnName(int columnIndex) {
        return columnNames[columnIndex];
    }

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
//		System.out.println(rowIndex + " : " + columnIndex);
//		System.out.println(data.length);
//		System.out.println(data[rowIndex][columnIndex]);
		return data[rowIndex][columnIndex];
	}

}
